var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
class Main {
    constructor() {
    }
    test1(a, b) {
        return __awaiter(this, void 0, void 0, function* () {
            return a + b;
        });
    }
    test2(a, b) {
        return __awaiter(this, void 0, void 0, function* () {
            var bb = a + b;
            let abc = yield this.test1(a, bb);
            return abc;
        });
    }
    // public async delayTime(millSecond:number):Promise<void>
    // {
    //     return new Promise((ok,error)=>{
    //         setTimeout(ok, millSecond);
    //     })
    // }
    // public delayTime2*(millSecond:number)
    // {
    //     new Promise((ok,error)=>{
    //         setTimeout(ok, millSecond);
    //     })
    // }
    test(div) {
        return __awaiter(this, void 0, void 0, function* () {
            let aa = yield this.test1(1, 2);
            div.innerHTML += aa + "<br/>";
            //await this.delayTime(1000);
            aa = yield this.test1(aa, yield this.test1(3, 4));
            div.innerHTML += aa + "<br/>";
            //await this.delayTime(1000);
            aa = yield this.test2(aa, 1);
            div.innerHTML += aa + "<br/>";
        });
    }
}
